{% extends 'base_home.htm' %}
{%block js%}
<script language="JavaScript" src="/static/js/switch.js"></script>
<script language="JavaScript" src="/static/js/ajax.js"></script>
{%endblock%}

{% block lbox%}
<div id="tips">  
  <p class="text_title" style="font-size:14px;">Tips
  {% if is_admin %}
	<a href="javascript:add_tip()" title="write"><img src="/static/images/edit.jpg" border="0" /></a>
  {% endif %}
  </p>
  <p id="tip_content">{{tip|default:"暂无tip"}}</p>
</div>
{%endblock%}
{% block middle %}
<div id="m1">
  <table cellspacing="0">
	<tr>
	  <td width="26%" align="center" class="m1_title">事件</td>
	  <td width="48%" class="m1_title">近期任务</td>
	  <td width="12%" class="m1_title">进度</td>
	  <td width="14%" class="m1_title">任务倒计时</td>
	</tr>
	{% for sube in se_list %}
	<tr>
	  <td><a href="../event/?event={{sube.se.event.key}}" title="{{sube.se.event.title}}">{{sube.se.event.title|slice:":20"}}</a></td>
	  <td>{{sube.se.content}}</td>
	  <td>
	  	<div class="progressbar"><div style="width:{{sube.se.event.progress}}%;"
	  	class="progresskenerl"></div></div>
	  </td>
	  <td>{{sube.days}}天</td>
	</tr>
	{% endfor %}
  </table>
</div>
<div id="m2">
  <div id="switch_menu">
	<table width="98%" border="0" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="td_slot">&nbsp;</td>
		<td id="new_event_title">
		  <a href="javascript:sw('new_event');" class="a_nounderline">事件动态({{hi_list|length}})</a>
		</td>
		<td class="td_slot">&nbsp;</td>
		<td id="new_comment_title">
		  <a href="javascript:sw('new_comment');" class="a_nounderline">评论({{comments|length}})</a>
		</td>
		<td class="td_slot">&nbsp;</td>
		<td id="new_message_title">
		  <a href="javascript:sw('new_message');" class="a_nounderline">留言({{mes_li|length}})</a>
		</td>
		<td></td>
	  </tr>
	</table>
  </div>
  <div id="new_event">
	<div class="each_event">
	  {%for hi in hi_list%}
	  <p>
		<span class="time">{{hi.publish_time|date:"m-d H:i"}}</span>
		{% autoescape off %}
		{{hi.content}}	{% endautoescape %}
		<a href="../event?event={{hi.event.key}}">({{hi.event.title}})</a>
	  </p>
	  {%endfor%}
	</div>
  </div>
  <div id="new_comment" style="display:none">
	<div class="tip">最近{{comments|length}}条评论。</div>
	{%for comment in comments %}
	<div class="each_comment" id="com_{{comment.key}">
	  <div class="each_comment_title">
		<table width="98%" border="0" cellspacing="0" cellpadding="0">
		  <tr>
			<td><a href="../home/?user={{comment.sender.user_id}}">{{comment.sender.nickname}}</a>
			  <span class="time">
				({{comment.publish_time|date:"Y-m-d H:i"}}，评论《<a href=../blog/?blog={{comment.blog.key}}>{{comment.blog.title}}</a>》)
			</span></td>
			{%if is_admin%}
			<td width="7%"><a href="javascript:del_comment('{{comment.key}}')">删除</a></td>
			{%endif%}
		  </tr>
		</table>
		<p>{{comment.content}}</p>
	  </div>
	</div>
	{%endfor%}
  </div>
  <div id="new_message" style="display:none;">
	<div class="tip">最近{{mes_li|length}}条留言，<a href="../message">转到留言板</a>。</div>
	{%for mes in mes_li%}
	<div class="each_comment">
	  <div class="each_comment_title">
		<table width="98%" border="0" cellspacing="0" cellpadding="0">
		  <tr>
			<td><a href="../home/?user={{mes.sender.user_id}}">{{mes.sender.nickname}}</a>
			  <span class="time">{{mes.publish_time|date:"Y-m-d H:i:s"}}</span></td>
			<td width="7%"><a href="javascript:del_mes('{{mes.key}}')">删除</a></td>
		  </tr>
		</table>
		<p>{{mes.content}}</p>
	  </div>
	</div>
	{%endfor%}
  </div>
</div>
{% endblock %}

